<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8" />
  <title>opencpn:opencpn_user_manual:plugins:included_plugins:grib_weather:mail_servers</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="opencpn,opencpn_user_manual,plugins,included_plugins,grib_weather,mail_servers"/>
<link rel="search" type="application/opensearchdescription+xml" href="../../../lib/exe/opensearch.html" title="OpenCPN Manuals"/>
<link rel="start" href="mail_servers.html"/>
<link rel="contents" href="mail_servers.html" title="Sitemap"/>
<link rel="alternate" type="application/rss+xml" title="Recent Changes" />
<link rel="alternate" type="application/rss+xml" title="Current namespace" />
<link rel="alternate" type="text/html" title="Plain HTML" href="mail_servers.html"/>
<link rel="alternate" type="text/plain" title="Wiki Markup" href="mail_servers.html"/>
<link rel="canonical" href="http://localhost/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:plugins:included_plugins:grib_weather:mail_servers"/>
<link rel="stylesheet" type="text/css" href="../../../lib/exe/css.php.t.bootstrap3.css"/>
<!--[if gte IE 9]><!-->
<script type="text/javascript">/*<![CDATA[*/var NS='opencpn:opencpn_user_manual:plugins:included_plugins:grib_weather';var JSINFO = {"id":"opencpn:opencpn_user_manual:plugins:included_plugins:grib_weather:mail_servers","namespace":"opencpn:opencpn_user_manual:plugins:included_plugins:grib_weather","confirm_delete":"Are you sure you want to delete this page?","doku_base":"\/dokuwiki\/","cg_rev":"","dw_version":49.5,"chrome_version":0,"hide_captcha_error":"none","ckg_dbl_click":"","ckg_canonical":0,"has_wrap":"Wrap","wrapDiv":"WRAP","wrapSpan":"wrap","ckgEdPaste":"off","rel_links":0,"isadmin":0,"isauth":0,"move_renameokay":false,"schemes":["http","https","telnet","gopher","wais","ftp","ed2k","irc","ldap"],"htmlok":0};
/*!]]>*/</script>
<script type="text/javascript" charset="utf-8" src="../../../lib/exe/jquery.php.t.bootstrap3.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../lib/exe/js.php.t.bootstrap3.js"></script>
<!--<![endif]-->

    <script type="text/javascript">
    //<![CDATA[ 
    function LoadScript( url )
    {
     document.write( '<scr' + 'ipt type="text/javascript" src="../../..//url"><\/scr' + 'ipt>' ) ;        

    }
   function LoadScriptDefer( url )
    {
     document.write( '<scr' + 'ipt type="text/javascript" src="../../..//url" defer><\/scr' + 'ipt>' ) ;        

    }
//]]> 

 </script>
</head>
<body>
<div class="dokuwiki export">

<h1 class="sectionedit1" id="mail_servers">Mail Servers</h1>
<div class="level1">

</div>
<!-- EDIT1 SECTION "Mail Servers" [1-28] -->
<h3 class="sectionedit2" id="warning">Warning!</h3>
<div class="level3">

<p>
<strong>This is an Advanced subject, that is not necessary for running the grib plugin.<br/>

Do not try these setups unless you are familiar with your operating system, comfortable with handling the command line interface and editing configuration files.<br/>

Do not expect these instructions to work without some customization.</strong>
</p>

<p>
This page contains detailed instructions on how to set up mailservers to automatically send grib request mails to Sail Docs.<br/>

“Ptizef” &amp; “rgleason” have compiled the instructions for<strong> Windows/Thunderbird</strong> <br/>

“Ptizef” has compiled the instructions for<strong> Linux/SSMTP.</strong> <br/>

“Cagney” has compiled the instructions for <strong>Linux/Exim4</strong>.<br/>

“CarCode” has compiled the instructions for <strong>Mac <abbr title="Operating System">OS</abbr> X/PostFix </strong>.
</p>

</div>
<!-- EDIT2 SECTION "Warning!" [29-772] -->
<h2 class="sectionedit3" id="windows_mapi_mail_server_setup">Windows MAPI Mail Server Setup</h2>
<div class="level2">

<p>
The plugin&#039;s email request depends on the user&#039;s selection of the default MAPI email program which is dependent on the Operating System conventions. Linux, Windows and Mac are all different. If the plugin does not find a default MAPI program, an appropriate message will show in the plugin menu:
</p>
<pre class="code"> Request can&#039;t be sent. Please verify your email system parameters.
 You should also have a look at your log file.
 Save or Cancel to finish...</pre>

<p>
and there will be an error message in the opencpn.log similar to:
</p>
<pre class="code"> 10:55:47 PM: MAIL Error: Failed to logon to MAPI using a shared session, Error:3</pre>

<p>
To fix this problem use a google search, and find links such as <a href="http://www.ctimls.com/support/kb/error%20fixes/fix_mapi_error.htm" class="urlextern" title="http://www.ctimls.com/support/kb/error%20fixes/fix_mapi_error.htm" rel="nofollow">Fix CLS Send, MAPI or Runtime Error in Email</a>
</p>

</div>
<!-- EDIT3 SECTION "Windows MAPI Mail Server Setup" [773-1596] -->
<h3 class="sectionedit4" id="windows_10_or_81_and_thunderbird">Windows 10 or 8.1 and Thunderbird</h3>
<div class="level3">

<p>
For example, if you use Thunderbird exclusively with Win10 or Win8.1, this should fix the problem
</p>
<pre class="code"> Start &gt; Control Panel &gt; Default Programs &gt; Set your Default Programs,  Then pick Thunderbird.</pre>

</div>
<!-- EDIT4 SECTION "Windows 10 or 8.1 and Thunderbird" [1597-1837] -->
<h3 class="sectionedit5" id="windows_vista_or_xp_and_thunderbird">Windows Vista or XP and Thunderbird</h3>
<div class="level3">

<p>
- <strong>Outside OpenCPN </strong>there is nothing more to do except to ensure that there is a mail system (mine is thunderbird) correctly configured and set as “main” on the device.<br/>

also verify if the mapi32.dll is present in c:/windows/system32 (or equivalent for 64b) (otherwise an error message will be the result).
</p>

<p>
- <strong>Inside OpenCPN</strong>, there is nothing to do; the sender mail address can be entered, but will not be used. Just don&#039;t forget to enter the zyGRIB login and password.
</p>

<p>
When clicking on “send” button :<br/>

if the “main” mail system is not open, OpenCPN opens it and the waiting messages are received.<br/>

remark : if there are many waiting messages, it could take a while. That is why it would be better to create a specific address for this purpose.<br/>

Then a new mail page is opened with all mail elements already written thus ready to be sent.
</p>

</div>
<!-- EDIT5 SECTION "Windows Vista or XP and Thunderbird" [1838-2736] -->
<h1 class="sectionedit6" id="linux">Linux</h1>
<div class="level1">

</div>
<!-- EDIT6 SECTION "Linux" [2737-2757] -->
<h3 class="sectionedit7" id="using_ssmtp">Using SSMTP</h3>
<div class="level3">

<p>
How to install and configure sSMTP:
</p>

<p>
- 1) Install the ssmtp package.<br/>

If another MTA is already installed, you may be asked to uninstall it before installing ssmtp.
</p>

<p>
Once it&#039;s done you can test it by typing this command:<br/>

“whereis sendmail”
</p>

<p>
The answer should be something like “/usr/sbin/sendmail”.
</p>

<p>
Use that answer in the next command:<br/>

“ls -la /usr/sbin/sendmail”
</p>

<p>
If everything is OK you should get this answer:<br/>

“/usr/sbin/sendmail → ssmtp”<br/>

showing that Sendmail function is now connected to ssmtp.
</p>

<p>
- 2) Now there are two files to set:
</p>

<p>
the first file : /etc/ssmtp/ssmtp.conf ( with root rights )<br/>

<br/>

The typical setting should be:<br/>

root=postmaster<br/>

AuthUser=yourlogin to your ISP access<br/>

AuthPass=yourpasseword to your ISP access<br/>

mailhub=yourISPserveurname.yourdomain (for example smtp.orange.fr)<br/>

rewriteDomain=yourdomain<br/>

FromLineOverride=YES<br/>

hostname= the full host-name ( normally automatically entered, but if not you can type the command : “hostname” to get it)<br/>

<br/>

For ISP requiring a TLS connection , it could be necessary to add the line UseTLS=YES or UseSTARTTLS=YES<br/>

<br/>

the second file : /etc/ssmtp/revaliases (with root rights)<br/>

<br/>

Enter this line.<br/>

root:yourlogin@yourdomain:yourISPserveurname.yourdomain

<br/>

the default port was 25 but now many ISP refuse it and use 587. If you have a mail system, you will find the right value in it.sudo dpkg-reconfigure exim4-config<br/>

Sendmail/Postfix install for Mac<br/>

- Inside OpenCPN :You must enter the sender address : your entire mail address, the one you will use to send mails and receive answers<br/>

<br/>

When you click on the “send” button, the mail is directly sent. You can find the log here : /var/log/mail.log<br/>

</p>

</div>
<!-- EDIT7 SECTION "Using SSMTP" [2758-4554] -->
<h3 class="sectionedit8" id="using_exim4">Using Exim4</h3>
<div class="level3">

<p>
First install Exim4<br/>

$sudo apt-get install exim4<br/>

then configure it (again).<br/>

$sudo dpkg-reconfigure exim4-config<br/>

This is a very simple setup where exim is just used to forward mail to the ISP:s smtp server. Local system mail is also available.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail1.tok.601846_w.650.jpg" class="media" alt="" width="650" /><br/>

It&#039;s important to use the choice above.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail2.tok.849373_w.650.jpg" class="media" alt="" width="650" /><br/>

I just use “localhost”.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail3.tok.e63bec_w.650.jpg" class="media" alt="" width="650" /><br/>

We have no incoming connections.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail4.tok.15b29b_w.650.jpg" class="media" alt="" width="650" /><br/>

We are not using this.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail5.tok.43d7ff_w.650.jpg" class="media" alt="" width="650" /><br/>

We are not using this.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail6.tok.c15216_w.650.jpg" class="media" alt="" width="650" /><br/>

This is important. It must point to your Internet Service Providers SMTP server.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail7.tok.0fa601_w.650.jpg" class="media" alt="" width="650" /><br/>

Your choice!
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail8.tok.b63870_w.650.jpg" class="media" alt="" width="650" /><br/>

<abbr title="Read The Fine Manual">RTFM</abbr> and make up your mind. Not a big deal for this simple setup.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail9.tok.8bb68f_w.650.jpg" class="media" alt="" width="650" /><br/>

<abbr title="Read The Fine Manual">RTFM</abbr>.
</p>

<p>
<img src="../../../opencpn/manual/plugins/grib/33gribmail10.tok.420277_w.650.jpg" class="media" alt="" width="650" /><br/>

Your Choice, but no point in splitting this simple setup.
</p>

<p>
Edit /etc/exim4/passwd.client so it contains your username and password  to your ISP:s mail server.
</p>
<div class="table sectionedit9"><table class="inline">
	<tr class="row0">
		<td class="col0"># password file used when the local exim is authenticating to a remote_PARA<em class="u">TABLE_INS_# host as a client._PARA</em>TABLE_INS_#_PARA<em class="u">TABLE_INS_# <strong>see exim4_passwd_client(5) for more documentation</strong>_PARA</em>TABLE_INS_#_PARA<em class="u">TABLE_INS_# Example:_PARA</em>TABLE_INS_### target.mail.server.example:login:password_PARA<em class="u">TABLE_INS_# for OpenCPN you can use  *:login:password_PARA</em>TABLE_INS_*:fakexyz123:madeupXYZ123</td>
	</tr>
</table></div>
<!-- EDIT9 TABLE [5917-6324] -->
<p>
(Re)start Exim4<br/>

$ /etc/init.d/exim4 {start|stop|restart|reload|status|what|force-stop}<br/>

Start testing<br/>

<br/>

<br/>

<br/>

</p>

</div>
<!-- EDIT8 SECTION "Using Exim4" [4555-6441] -->
<h1 class="sectionedit10" id="mac_os_x">Mac OS X</h1>
<div class="level1">

</div>
<!-- EDIT10 SECTION "Mac OS X" [6442-6465] -->
<h3 class="sectionedit11" id="using_sendmailpostfix">Using Sendmail/Postfix</h3>
<div class="level3">

<p>
<br/>

It is not so easy to install this on a Mac since you will need some experience with terminal using. The example below uses an googlemail account and nano as editor:<br/>

<br/>

Step 1<br/>

Type in terminal these 6 lines one after another with return:<br/>

sudo mkdir -p /Library/Server/Mail/Data/spool<br/>

<br/>

sudo gzip /usr/share/man/man1/{postalias.1,postcat.1,postconf.1,postdrop.1,postf ix.1,postkick.1,postlock.1,postlog.1,postmap.1,pos tmulti.1,postqueue.1,postsuper.1,sendmail.1}<br/>

<br/>

sudo gzip /usr/share/man/man5/{access.5,aliases.5,bounce.5,canonical.5,cidr_tabl e.5,generic.5,header_checks.5,ldap_table.5,master. 5,mysql_table.5,nisplus_table.5,pcre_table.5,pgsql _table.5,postconf.5,postfix-wrapper.5,regexp_table.5,relocated.5,tcp_table.5,t ransport.5,virtual.5}<br/>

<br/>

sudo gzip /usr/share/man/man8/{anvil.8,bounce.8,cleanup.8,discard.8,error.8,flus h.8,local.8,master.8,oqmgr.8,pickup.8,pipe.8,proxy map.8,qmgr.8,qmqpd.8,scache.8,showq.8,smtp.8,smtpd .8,spawn.8,tlsmgr.8,trivial-rewrite.8,verify.8,virtual.8}<br/>

<br/>

sudo /usr/sbin/postfix set-permissions<br/>

<br/>

sudo chmod 700 /Library/Server/Mail/Data/mta<br/>

<br/>

Step 2<br/>

Type in terminal another command to start the nano editor with this file:<br/>

sudo nano /etc/postfix/sasl_passwd<br/>

<br/>

Type into the nano editor:<br/>

smtp.googlemail.com:587 YourAccountname@googlemail.com:YourPassword<br/>

<br/>

Substitute YourAccountname and YourPassword with your data.<br/>

Save the file in nano with Ctrl-O and exit with Ctrl-X.<br/>

<br/>

Step 3<br/>

Publicate the new file in terminal with this command:<br/>

sudo postmap /etc/postfix/sasl_passwd<br/>

<br/>

Step 4<br/>

You have to edit the main config file and add at the end the following lines with<br/>

this command in Terminal:<br/>

sudo nano /etc/postfix/main.cf<br/>

<br/>

This to add:<br/>

# Minimum Postfix-specific configurations.<br/>

mydomain_fallback = localhost<br/>

mail_owner = _postfix<br/>

setgid_group = _postdrop<br/>

relayhost=smtp.googlemail.com:587<br/>

<br/>

# Enable SASL authentication in the Postfix SMTP client.<br/>

smtp_sasl_auth_enable=yes<br/>

smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd<br/>

smtp_sasl_security_options=<br/>

<br/>

# Enable Transport Layer Security (TLS), i.e. SSL.<br/>

smtp_use_tls=yes<br/>

smtp_tls_security_level=encrypt<br/>

tls_random_source=dev:/dev/urandom<br/>

<br/>

Save the file and exit nano as in step 2.<br/>

<br/>

Step 5<br/>

Now you can start postfix in terminal with:<br/>

sudo postfix start<br/>

<br/>

If an error occurs correct main.cf and start again with:<br/>

sudo postfix reload<br/>

<br/>

Step 6<br/>

Now you can test your work in terminal with:<br/>

date | mail -s test <a href="mailto:&#x59;&#x6f;&#x75;&#x72;&#x41;&#x63;&#x63;&#x6f;&#x75;&#x6e;&#x74;&#x6e;&#x61;&#x6d;&#x65;&#x40;&#x67;&#x6f;&#x6f;&#x67;&#x6c;&#x65;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#x6d;" class="mail" title="&#x59;&#x6f;&#x75;&#x72;&#x41;&#x63;&#x63;&#x6f;&#x75;&#x6e;&#x74;&#x6e;&#x61;&#x6d;&#x65;&#x40;&#x67;&#x6f;&#x6f;&#x67;&#x6c;&#x65;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#x6d;">YourAccountname@googlemail.com</a><br/>

<br/>

<br/>

Done.<br/>

Supplemental<br/>

If you want to have started sendmail/postfix each time you start you start<br/>

your machine you can add these lines to the launch daemon:<br/>

&lt;key&gt;RunAtLoad&lt;/key&gt;<br/>

&lt;true/&gt;<br/>

<br/>

Do this with this command in terminal:<br/>

sudo nano /System/Library/LaunchDaemons/org.postfix.master.plist<br/>

<br/>

After that this file should look like this:<br/>

&lt;?xml version=“1.0” encoding=“UTF-8”?&gt;<br/>

&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;<br/>

&lt;plist version=“1.0”&gt;<br/>

&lt;dict&gt;<br/>

&lt;key&gt;Label«/key&gt;<br/>

&lt;string&gt;org.postfix.master&lt;/string&gt;<br/>

&lt;key&gt;Program&lt;/key&gt;<br/>

&lt;string&gt;/usr/libexec/postfix/master&lt;/string&gt;<br/>

&lt;key&gt;ProgramArguments&lt;/key&gt;<br/>

&lt;array&gt;<br/>

&lt;string&gt;master&lt;/string&gt;<br/>

&lt;string&gt;-e&lt;/string&gt;<br/>

&lt;string&gt;60&lt;/string&gt;<br/>

&lt;/array&gt;<br/>

&lt;key&gt;QueueDirectories&lt;/key&gt;<br/>

&lt;array&gt;<br/>

&lt;string&gt;/var/spool/postfix/maildrop&lt;/string&gt;<br/>

&lt;/array&gt;<br/>

&lt;key&gt;AbandonProcessGroup&lt;/key&gt;<br/>

&lt;true/&gt;<br/>

&lt;key&gt;OnDemand/lt;/key&gt;<br/>

&lt;true/&gt;<br/>

&lt;key&gt;RunAtLoad&lt;/key&gt;<br/>

&lt;true/&gt;<br/>

&lt;/dict&gt;<br/>

&lt;/plist&gt;<br/>

</p>

<p>
Instead of googlemail in this example you may use any other mail server.
</p>

</div>
<!-- EDIT11 SECTION "Using Sendmail/Postfix" [6466-] -->
<!-- no cachefile used, but created /var/www/html/dokuwiki/data/cache/4/43b5cfaf94e37ba7d57f68adfcfba33f.xhtml -->
</div>
</body>
</html>
